//package com.jingdianjichi.auth.application.interceptor;
//
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.Objects;
//
//
///**
// * @Description: feign 请求拦截器
// * @Author: 张广焱
// * @Date: 2024-02-14 22:15
// */
//@Component
//public class FeginRequestInterceptor  implements RequestInterceptor {
//    /**
//     * @Description: 专门对feign请求做处理
//     * @Param: @param requestTemplate
//     * @Author: 张广焱
//     * @Date: 2024-02-14  22:15:46
//     */
//    @Override
//    public void apply(RequestTemplate requestTemplate) {
//        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//        HttpServletRequest request = requestAttributes.getRequest();
//        if (Objects.nonNull(request)){
//            String loginId = request.getHeader("loginId");
//            if (StringUtils.isNotBlank(loginId)){
//                requestTemplate.header("loginId",loginId);
//            }
//        }
//    }
//}
